package edu.chinasoft.aop01;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.aspectj.lang.JoinPoint;

public
class Aspect01 {
    private Log log = LogFactory.getLog(Aspect01.class);
    public void method_before(JoinPoint joinPoint){
        log.info( "Aspect01>>>method_before start……" );
        //通过参数joinPoint目标类方法的相关信息
        //获取目标类的名字
        String targetClassName = joinPoint.getTarget().getClass().getName();
        String methodName = joinPoint.getSignature().getName();
        Object[] argForArray = joinPoint.getArgs();
        log.info( "该方法在类:"+targetClassName+"的方法："+methodName+"方法参数个数："+argForArray.length+"之前执行！" );
        log.info( "Aspect01>>>method_before end……" );
    }
}
